import time

from selenium.webdriver.common.by import By

from common.DriverTools import DriverTools


class HomePage(object):
    def __init__(self):
        self.driver=DriverTools.get_driver()
        # 登录按钮
        self.login_btn=(By.LINK_TEXT,'登录')
        # 注册按钮
        self.register_btn=(By.LINK_TEXT,'注册')

    # 进入登录页面
    def goto_login_page(self):
        self.driver.find_element(*self.login_btn).click()

    # 进入注册页面
    def goto_register_page(self):
        self.driver.find_element(*self.register_btn).click()

if __name__ == '__main__':
    driver=DriverTools.get_driver()
    driver.get("http://hmshop-test.itheima.net/")
    # HomePage().goto_login_page()
    HomePage().goto_register_page()
    time.sleep(2)
    driver.quit()